function setCookie(c_name, value){
	var exdate = new Date();
	document.cookie = c_name + "=" + escape(value);
}

function setCookie(c_name, value, expiredays){
	var exdate = new Date();
	exdate.setDate(exdate.getDate() + expiredays);
	document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires="
		+exdate.toGMTString());
}

function getCookie(name)//取cookies函数        
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) 
    	 return unescape(arr[2]);
     return null;
}
